import * as req from '@/request';

export async function list(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.TicketList>('/ticket/list', params, sorter, filter);
}

export async function dateCount(params: { [key: string]: any }) {
  return req.get<API.DateStatList>('/ticket/datecount', params);
}

export async function statusCount(params: { [key: string]: any }) {
  return req.get<API.StatusStatList>('/ticket/statuscount', params);
}

export async function get(data: { [key: string]: any }) {
  return req.postForm<API.TicketModel>('/ticket/get', data);
}

export async function reply(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/reply', data);
}

export async function updateStatus(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/updatestatus', data);
}

export async function updateInfo(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/updateinfo', data);
}

export async function close(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/close', data);
}

export async function closelist(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/closelist', data);
}

export async function finish(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/ticket/finish', data);
}
